<?php

/**
 * @BelongProject: flami_mangers
 * @Author: Zwc
 * @CreateTime: 2025-11-01 19:01:48
 * @Description: TODO
 */

namespace App\Api;

use App\Domain\LevelAnchorDomain;
use PhalApi\Api;

class LevelAnchor extends Api
{

    public function getRules()
    {
        return [
            'getLevelAnchor' => [
                'langId' => ['name' => 'langId', 'type' => 'int', 'desc' => '语言ID']
            ]
        ];
    }

    /**
     * 获取所有的直播等级
     * @return array
     */
    public function getLevelAnchor(): array
    {
        $langId = \App\checkNull($this->langId);
        if (empty($langId)) {
            $rs['code'] = 500;
            $rs['msg'] = \PhalApi\T('所属语言ID不能为空');
            return $rs;
        }
        return [
            'code' => 0,
            'msg' => '获取数据成功',
            'info' => LevelAnchorDomain::getLevelAnchorData($langId)
        ];
    }


}